package presenter.impl;

import presenter.IOpenDoorPresenter;
import view.IOpenDoorCallback;

public class OpenDoorPresenter implements IOpenDoorPresenter {

    private IOpenDoorCallback mViewCallback;
    @Override
    public void openTheDoor(){
        mViewCallback.onOpening("正在开门...\n");
        try{

            Thread.sleep(3000);
        }catch (InterruptedException e){

        }
        mViewCallback.onOpenedDoor("门已打开");
    }

    @Override
    public void registerViewCallback(IOpenDoorCallback callback) {
        mViewCallback=callback;
    }

    @Override
    public void unregisterViewCallback(IOpenDoorCallback callback) {
        mViewCallback=null;
    }
}
